﻿<?php require_once('Connections/satphp.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
$idturma=$_GET['idturma'];
$idatividade=$_GET['idatividade'];
//mostra os alunos que estão na turma 
mysql_select_db($database_satphp, $satphp);
$query_RSturma = "select idaluno, nome from aluno where idturma='$idturma';";
$RSturma = mysql_query($query_RSturma, $satphp) or die(mysql_error());
$row_RSturma = mysql_fetch_assoc($RSturma);
$totalRows_RSturma = mysql_num_rows($RSturma);

	

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Avaliação de atividades</title>
</head>

<body>
<form name="avaliar" method="post" action="nota-registrar.php?idatividade=<?php echo $idatividade ?>" >
<table width="200" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th scope="col">Aluno</th>
    <th scope="col">Nota</th>
  </tr>
  <?php $i =1;
  do { 
  ?>
  <tr>
  <td><input name="id<?php echo $i ?>" value="<?php echo $row_RSturma['idaluno'] ?>" type="hidden" /><?php echo $row_RSturma['nome'] ?> </td>
  <td><input name="nota<?php echo $i ?>" type="text" size="3" maxlength="3" value="0" /></td>
  </tr>
  <?php
  $i++;
  } while ($row_RSturma = mysql_fetch_assoc($RSturma)); ?>
  <tr>
  	<td colspan="2"><input type="hidden" name="qtd" id="qtd" value="<?php echo $i-1 ?>" /><input type="submit" value="Eviar" /></td>
  </tr>
  <tr>
  	<td colspan="2">
    *Notas de 0 a 100<br />
	*100=10,0
    </td>
  </tr>
</table>
</form>
</body>
</html>
<?php
mysql_free_result($RSturma);
?>
